package mvc1;

import java.util.Date;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import util.DateUtil;

@Controller
public class HelloController {

    @RequestMapping("/hello.do")
    public String hello(Model model) {
        model.addAttribute("data1", "hello, world!");
        return "hello";
    }

    @RequestMapping("/world.do")
    public String world(Model model) {
        model.addAttribute("data1", "안녕하세요!");
        model.addAttribute("data2", DateUtil.toYMDHMS(new Date()));
        return "world";
    }

}
